package com.litbw.user;
/**
 * @author Derrick Mink
 */
public enum UserRole {
	CONTESTANT, JUDGE, ORGANIZER, UNASSIGNED;
	
	public static UserRole roleFromOrdinal(final int ordinal) {
		
		switch (ordinal) {
		case 0:
			return CONTESTANT;
		case 1:
			return JUDGE;
		case 2:
			return ORGANIZER;
		case 3:
			return UNASSIGNED;
		default:
			throw new IllegalArgumentException(
					"cannot obtain user role from ordinal[" + ordinal + "]");
		}
		
	}
	
}
